package com.kexun.controller;

import com.kexun.annotation.RequestBody;
import com.kexun.annotation.RequestMapping;
import com.kexun.annotation.ResponseBody;
import com.kexun.dao.ManageDao;
import com.kexun.entity.Manage;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("manage")
public class ManageController {
    @ResponseBody
    @RequestMapping("add")
    public Map<String, Object> add(@RequestBody Manage manage) {
        System.out.println("manage:" + manage);
        ManageDao.add(manage);
        Map<String, Object> result = new HashMap<>();
        result.put("code", 0);
        result.put("message", "添加成功");
        return result;
    }

    @ResponseBody
    @RequestMapping("list")
    public List<Manage> list() {
        return ManageDao.list();
    }

}
